﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.ComponentModel;
using System.Collections.Generic;

namespace Nok_Air.NokObjects
{
    public class GetPassengersResultViewModel : INotifyPropertyChanged
    {
        /*
         <Response xmlns="">
          <Code>0000</Code>
          <ResponseDesc>Success.</ResponseDesc>
          <Flight>
            <FlightNo>DD9521</FlightNo>
            <FlightDate>2011/05/17</FlightDate>
            <DepartFrom>KOP</DepartFrom>
            <LDepartFrom>NAKHONPANOM</LDepartFrom>
            <DepartTime>16:40</DepartTime>
            <ArriveTo>DMK</ArriveTo>
            <LArriveTo>DON MUEANG</LArriveTo>
            <ArrivalTime>18:20</ArrivalTime>
            <AircraftType>AT7</AircraftType>
            <GateNo />
            <Passengers>
              <Passenger>
                <RowID>4902209</RowID>
                <BookingNo>10922431</BookingNo>
                <PNRNo>KPFLLV</PNRNo>
                <Name>WILKINSON/PRAPHAI MRS</Name>
                <SeatNo />
                <ClassCode>H</ClassCode>
                <PassengerType>ADULT</PassengerType>
                <MemberID />
                <CheckInStatus>N</CheckInStatus>
                <CreditCardNo />
                <CheckInChannel>1</CheckInChannel>
              </Passenger>
            </Passengers>
          </Flight>
        </Response>
         */
        private string _Code;
        public string Code
        {
            get
            {
                return _Code;
            }
            set
            {
                if (value != _Code)
                {
                    _Code = value;
                    NotifyPropertyChanged("Code");
                }
            }
        }

        private string _ResponseDesc;
        public string ResponseDesc
        {
            get
            {
                return _ResponseDesc;
            }
            set
            {
                if (value != _ResponseDesc)
                {
                    _ResponseDesc = value;
                    NotifyPropertyChanged("ResponseDesc");
                }
            }
        }
        private List<FlightGetPassengersResult> _Flights;
        public List<FlightGetPassengersResult> Flights
        {
            get
            {
                return _Flights;
            }
            set
            {
                if (value != _Flights)
                {
                    _Flights = value;
                    NotifyPropertyChanged("Flights");
                }
            }
        }
   

        public event PropertyChangedEventHandler PropertyChanged;
        private void NotifyPropertyChanged(String propertyName)
        {
            PropertyChangedEventHandler handler = PropertyChanged;
            if (null != handler)
            {
                handler(this, new PropertyChangedEventArgs(propertyName));
            }
        }
    }
    public class FlightGetPassengersResult : INotifyPropertyChanged
    {
        public string From
        {
            get
            {
                return App.ViewModel.From;
            }
            //   set; 
        }
        public string To
        {
            get
            {
                return App.ViewModel.To;
            }
            //   set; 
        }
        public string Date
        {
            get
            {
                return App.ViewModel.Date;
            }
            //   set; 
        }
        public string Time
        {
            get
            {
                return App.ViewModel.Time;
            }
            //   set; 
        }
        public string Flight
        {
            get
            {
                return App.ViewModel.FlightNo;
            }
            //   set; 
        }
        /*
          <Flight>
            <FlightNo>DD9521</FlightNo>
            <FlightDate>2011/05/17</FlightDate>
            <DepartFrom>KOP</DepartFrom>
            <LDepartFrom>NAKHONPANOM</LDepartFrom>
            <DepartTime>16:40</DepartTime>
            <ArriveTo>DMK</ArriveTo>
            <LArriveTo>DON MUEANG</LArriveTo>
            <ArrivalTime>18:20</ArrivalTime>
            <AircraftType>AT7</AircraftType>
            <GateNo />
            <Passengers>
              <Passenger>
                <RowID>4902209</RowID>
                <BookingNo>10922431</BookingNo>
                <PNRNo>KPFLLV</PNRNo>
                <Name>WILKINSON/PRAPHAI MRS</Name>
                <SeatNo />
                <ClassCode>H</ClassCode>
                <PassengerType>ADULT</PassengerType>
                <MemberID />
                <CheckInStatus>N</CheckInStatus>
                <CreditCardNo />
                <CheckInChannel>1</CheckInChannel>
              </Passenger>
            </Passengers>
          </Flight>
         */

        private string _FlightNo;
        public string FlightNo
        {
            get
            {
                return _FlightNo;
            }
            set
            {
                if (value != _FlightNo)
                {
                    _FlightNo = value;
                    NotifyPropertyChanged("FlightNo");
                }
            }
        }
        private string _FlightDate;
        public string FlightDate
        {
            get
            {
                return _FlightDate;
            }
            set
            {
                if (value != _FlightDate)
                {
                    _FlightDate = value;
                    NotifyPropertyChanged("FlightDate");
                }
            }
        }
        private string _DepartFrom;
        public string DepartFrom
        {
            get
            {
                return _DepartFrom;
            }
            set
            {
                if (value != _DepartFrom)
                {
                    _DepartFrom = value;
                    NotifyPropertyChanged("DepartFrom");
                }
            }
        }
        private string _LDepartFrom;
        public string LDepartFrom
        {
            get
            {
                return _LDepartFrom;
            }
            set
            {
                if (value != _LDepartFrom)
                {
                    _LDepartFrom = value;
                    NotifyPropertyChanged("LDepartFrom");
                }
            }
        }
        private string _DepartTime;
        public string DepartTime
        {
            get
            {
                return _DepartTime;
            }
            set
            {
                if (value != _DepartTime)
                {
                    _DepartTime = value;
                    NotifyPropertyChanged("DepartTime");
                }
            }
        }
        private string _ArriveTo;
        public string ArriveTo
        {
            get
            {
                return _ArriveTo;
            }
            set
            {
                if (value != _ArriveTo)
                {
                    _ArriveTo = value;
                    NotifyPropertyChanged("ArriveTo");
                }
            }
        }
        private string _LArriveTo;
        public string LArriveTo
        {
            get
            {
                return _LArriveTo;
            }
            set
            {
                if (value != _LArriveTo)
                {
                    _LArriveTo = value;
                    NotifyPropertyChanged("LArriveTo");
                }
            }
        }
        private string _ArrivalTime;
        public string ArrivalTime
        {
            get
            {
                return _ArrivalTime;
            }
            set
            {
                if (value != _ArrivalTime)
                {
                    _ArrivalTime = value;
                    NotifyPropertyChanged("ArrivalTime");
                }
            }
        }
        private string _AircraftType;
        public string AircraftType
        {
            get
            {
                return _AircraftType;
            }
            set
            {
                if (value != _AircraftType)
                {
                    _AircraftType = value;
                    NotifyPropertyChanged("AircraftType");
                }
            }
        }
        private string _GateNo;
        public string GateNo
        {
            get
            {
                return _GateNo;
            }
            set
            {
                if (value != _GateNo)
                {
                    _GateNo = value;
                    NotifyPropertyChanged("GateNo");
                }
            }
        }
        private List<PassengerGetPassengersResult> _Passengers;
        public List<PassengerGetPassengersResult> Passengers
        {
            get
            {
                return _Passengers;
            }
            set
            {
                if (value != _Passengers)
                {
                    _Passengers = value;
                    NotifyPropertyChanged("Passengers");
                }
            }
        }
        public event PropertyChangedEventHandler PropertyChanged;
        private void NotifyPropertyChanged(String propertyName)
        {
            PropertyChangedEventHandler handler = PropertyChanged;
            if (null != handler)
            {
                handler(this, new PropertyChangedEventArgs(propertyName));
            }
        }
    }
    public class PassengerGetPassengersResult : INotifyPropertyChanged
    {
        public string Class
        {
            get
            {
                return App.ViewModel.Class;
            }
        }
        public string SeatNoStr
        {
            get
            {
                return App.ViewModel.SeatNo;
            }
        }
        public string StatusStr
        {
            get
            {
                return App.ViewModel.Status;
            }
        }

        public string PassengerName
        {
            get
            {
                return App.ViewModel.PassengerName;
            }
        }
        public string BoardingTimeStr
        {
            get
            {
                return App.ViewModel.BoardingTimeStr;
            }
        }
        public string CheckInSeqStr
        {
            get
            {
                return App.ViewModel.CheckInSeqStr;
            }
        }
        /*
          <Passengers>
              <Passenger>
                <RowID>4902209</RowID>
                <BookingNo>10922431</BookingNo>
                <PNRNo>KPFLLV</PNRNo>
                <Name>WILKINSON/PRAPHAI MRS</Name>
                <SeatNo />
                <ClassCode>H</ClassCode>
                <PassengerType>ADULT</PassengerType>
                <MemberID />
                <CheckInStatus>N</CheckInStatus>
                <CreditCardNo />
                <CheckInChannel>1</CheckInChannel>
              </Passenger>
            </Passengers>
         */
        
        // additional for use in checkin
       
        /*
        <Meal />      
        <CheckInSeq>2</CheckInSeq>
        <CheckInTime>23:31:43</CheckInTime>
        <BoardingTime>16:20</BoardingTime>
        <Barcode>images/Barcode/DD9521-2.png</Barcode>
         */
        private string _RowID;
        public string RowID
        {
            get
            {
                return _RowID;
            }
            set
            {
                if (value != _RowID)
                {
                    _RowID = value;
                    NotifyPropertyChanged("RowID");
                }
            }
        }
        private string _BookingNo;
        public string BookingNo
        {
            get
            {
                return _BookingNo;
            }
            set
            {
                if (value != _BookingNo)
                {
                    _BookingNo = value;
                    NotifyPropertyChanged("BookingNo");
                }
            }
        }
        private string _PNRNo;
        public string PNRNo
        {
            get
            {
                return _PNRNo;
            }
            set
            {
                if (value != _PNRNo)
                {
                    _PNRNo = value;
                    NotifyPropertyChanged("PNRNo");
                }
            }
        }
        private string _Name;
        public string Name
        {
            get
            {
                return _Name;
            }
            set
            {
                if (value != _Name)
                {
                    _Name = value;
                    NotifyPropertyChanged("Name");
                }
            }
        }
        private string _SeatNo;
        public string SeatNo
        {
            get
            {
                return _SeatNo;
            }
            set
            {
                if (value != _SeatNo)
                {
                    _SeatNo = value;                  
                    NotifyPropertyChanged("SeatNo");
                }
            }
        }
        private string _ClassCode;
        public string ClassCode
        {
            get
            {
                return _ClassCode;
            }
            set
            {
                if (value != _ClassCode)
                {
                    _ClassCode = value;
                    NotifyPropertyChanged("ClassCode");
                }
            }
        }
        private string _PassengerType;
        public string PassengerType
        {
            get
            {
                return _PassengerType;
            }
            set
            {
                if (value != _PassengerType)
                {
                    _PassengerType = value;
                    NotifyPropertyChanged("PassengerType");
                }
            }
        }
        private string _MemberID;
        public string MemberID
        {
            get
            {
                return _MemberID;
            }
            set
            {
                if (value != _MemberID)
                {
                    _MemberID = value;
                    NotifyPropertyChanged("MemberID");
                }
            }
        }
        private string _CheckInStatus;
        public string CheckInStatus
        {
            get
            {
                return _CheckInStatus;
            }
            set
            {
                if (value != _CheckInStatus)
                {
                    _CheckInStatus = value;
                    NotifyPropertyChanged("CheckInStatus");
                }
            }
        }
        private string _CreditCardNo;
        public string CreditCardNo
        {
            get
            {
                return _CreditCardNo;
            }
            set
            {
                if (value != _CreditCardNo)
                {
                    _CreditCardNo = value;
                    NotifyPropertyChanged("CreditCardNo");
                }
            }
        }
        private string _CheckInChannel;
        public string CheckInChannel
        {
            get
            {
                return _CheckInChannel;
            }
            set
            {
                if (value != _CheckInChannel)
                {
                    _CheckInChannel = value;
                    NotifyPropertyChanged("CheckInChannel");
                }
            }
        }

        private string _Meal;
        public string Meal
        {
            get
            {
                return _Meal;
            }
            set
            {
                if (value != _Meal)
                {
                    _Meal = value;
                    NotifyPropertyChanged("Meal");
                }
            }
        }
        private string _CheckInSeq;
        public string CheckInSeq
        {
            get
            {
                return _CheckInSeq;
            }
            set
            {
                if (value != _CheckInSeq)
                {
                    _CheckInSeq = value;
                    NotifyPropertyChanged("CheckInSeq");
                }
            }
        }
        private string _CheckInTime;
        public string CheckInTime
        {
            get
            {
                return _CheckInTime;
            }
            set
            {
                if (value != _CheckInTime)
                {
                    _CheckInTime = value;
                    NotifyPropertyChanged("CheckInTime");
                }
            }
        }
        private string _BoardingTime;
        public string BoardingTime
        {
            get
            {
                return _BoardingTime;
            }
            set
            {
                if (value != _BoardingTime)
                {
                    _BoardingTime = value;
                    NotifyPropertyChanged("BoardingTime");
                }
            }
        }
        private string _Barcode;
        public string Barcode
        {
            get
            {
                return _Barcode;
            }
            set
            {
                if (value != _Barcode)
                {
                    _Barcode = value;
                    NotifyPropertyChanged("Barcode");
                }
            }
        }
        public event PropertyChangedEventHandler PropertyChanged;
        private void NotifyPropertyChanged(String propertyName)
        {
            PropertyChangedEventHandler handler = PropertyChanged;
            if (null != handler)
            {
                handler(this, new PropertyChangedEventArgs(propertyName));
            }
        }
    }
}